<?php /* Smarty version 2.6.16, created on 2012-09-06 08:20:23
         compiled from replays.tpl */ ?>
<div id="paging"> 
<?php echo '
<!--<script type="text/javascript">
$(document).ready(function($){
	$(\'#accordion\').dcAccordion({
		showCount: true,
		saveState: true
	});
	$(\'#accordion-1\').dcAccordion({
		eventType: \'click\',
		autoClose: true,
		saveState: true,
		disableLink: true,
		speed: \'slow\'
	});
					
});
</script>
-->
<script type="text/javascript">
function SortingList(sorting_url,sorting_by)
{
var params = {
	\'list_for\':\'sorting\',
	\'sorting_by\': sorting_by,
	\'IsProcess\': \'Y\',
	\'action\': \'send\',
};

$.ajax({
	type: "GET",
	url: sorting_url,
	data: params,			
	dataType: \'html\',
	success: function(data)
	{				
		$(".container-inner").html(data+"<div class=\'clear\'></div>");
	}
});
return false;		
}
</script>
<script type="text/javascript">
function redirect_function(id)
{
//alert(id);
  document.forms["videoform"+id].submit();
}
</script>
<script type="text/javascript">
  function LikeVideo(coach_id,video_id,like,numlike)
 { 	 
 
	var str1=  \'</div></a>\';
	if(numlike<1 ) numlike=parseInt(numlike);	
	
 	if(like == \'N\')
	{ 
		numlike=parseInt(numlike+1);
		var str=  \'<a href="javascript:;" onclick=\\"return LikeVideo(\'+coach_id+\',\'+video_id+\',\\\'Y\\\',\'+numlike+\')\\"><div class="game-rating">\';		 
	 $.ajax({
		   url:\'like_post.php\',
		   data:\'action=sendlike&coach_id=\'+coach_id+\'&video_id=\'+video_id,
		   type:\'post\',		 
		   dataType:\'html\', 
		   success:function(resp){			  
			  	 $(\'#game-rating_\'+video_id).html(str+resp+str1);
				  $(\'#votes_\'+video_id).html(numlike);								
			}			   
	});
	}
	else
	{
		numlike=parseInt(numlike-1);
		var str2=  \'<a href="javascript:;" onclick=\\"return LikeVideo(\'+coach_id+\',\'+video_id+\',\\\'N\\\',\'+numlike+\')\\"><div class="game-rating">\';
		 $.ajax({
		   url:\'like_post.php\',
		   data:\'action=sendunlike&coach_id=\'+coach_id+\'&video_id=\'+video_id,
		   type:\'post\',		 
		   dataType:\'html\', 
		   success:function(resp){		  		  
			  	 $(\'#game-rating_\'+video_id).html(str2+resp+str1);	
				 $(\'#votes_\'+video_id).html(numlike);		
				 						
			}			   
	});	
	}
}

</script>
'; ?>

 <!-- <div class="left-panel">
   <div class="graphite demo-container">
	<ul class="accordion" id="accordion-1">
	   <li><a href="#"><?php echo $this->_tpl_vars['game_name']; ?>
</a>
        <ul>
            <?php if ($this->_tpl_vars['Numrace'] > 0): ?>
			<li><a href="#">Race</a>
                <ul>
                    <li><a href="#" onclick="ManagerGeneral('<?php echo $this->_tpl_vars['page_name']; ?>
?action=list_search&from=<?php echo $this->_tpl_vars['from']; ?>
&from_page=<?php echo $this->_tpl_vars['from_page']; ?>
')">All <span>(<?php echo $this->_tpl_vars['totRec']; ?>
)</span></a></li>
                    <?php unset($this->_sections['race']);
$this->_sections['race']['name'] = 'race';
$this->_sections['race']['loop'] = is_array($_loop=$this->_tpl_vars['RaceArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['race']['show'] = true;
$this->_sections['race']['max'] = $this->_sections['race']['loop'];
$this->_sections['race']['step'] = 1;
$this->_sections['race']['start'] = $this->_sections['race']['step'] > 0 ? 0 : $this->_sections['race']['loop']-1;
if ($this->_sections['race']['show']) {
    $this->_sections['race']['total'] = $this->_sections['race']['loop'];
    if ($this->_sections['race']['total'] == 0)
        $this->_sections['race']['show'] = false;
} else
    $this->_sections['race']['total'] = 0;
if ($this->_sections['race']['show']):

            for ($this->_sections['race']['index'] = $this->_sections['race']['start'], $this->_sections['race']['iteration'] = 1;
                 $this->_sections['race']['iteration'] <= $this->_sections['race']['total'];
                 $this->_sections['race']['index'] += $this->_sections['race']['step'], $this->_sections['race']['iteration']++):
$this->_sections['race']['rownum'] = $this->_sections['race']['iteration'];
$this->_sections['race']['index_prev'] = $this->_sections['race']['index'] - $this->_sections['race']['step'];
$this->_sections['race']['index_next'] = $this->_sections['race']['index'] + $this->_sections['race']['step'];
$this->_sections['race']['first']      = ($this->_sections['race']['iteration'] == 1);
$this->_sections['race']['last']       = ($this->_sections['race']['iteration'] == $this->_sections['race']['total']);
?>
					<?php if ($this->_tpl_vars['RaceArr'][$this->_sections['race']['index']]['countrow'] != '0'): ?>
					 <li><a href="#"
onclick="ManagerGeneral('<?php echo $this->_tpl_vars['page_name']; ?>
?action=list_search&dosearch=GO&race_id=<?php echo $this->_tpl_vars['RaceArr'][$this->_sections['race']['index']]['race_id']; ?>
&from=<?php echo $this->_tpl_vars['from']; ?>
&<?php echo $this->_tpl_vars['SLink']; ?>
&from_page=<?php echo $this->_tpl_vars['from_page']; ?>
')"><?php echo $this->_tpl_vars['RaceArr'][$this->_sections['race']['index']]['race_title']; ?>
 <span>(<?php echo $this->_tpl_vars['RaceArr'][$this->_sections['race']['index']]['countrow']; ?>
)</span></a></li>
					 <?php endif; ?>
                    <?php endfor; endif; ?>
                </ul>
            </li>
			<?php endif; ?>
            <?php if ($this->_tpl_vars['Numladder'] > 0): ?>
			<li><a href="#">Ladder</a>
                <ul>
                    <li><a href="#" onclick="ManagerGeneral('<?php echo $this->_tpl_vars['page_name']; ?>
?action=list_search&from=<?php echo $this->_tpl_vars['from']; ?>
&from_page=<?php echo $this->_tpl_vars['from_page']; ?>
')">All <span>(<?php echo $this->_tpl_vars['totRec']; ?>
)</span></a></li>
					<?php unset($this->_sections['ladder']);
$this->_sections['ladder']['name'] = 'ladder';
$this->_sections['ladder']['loop'] = is_array($_loop=$this->_tpl_vars['LadderArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['ladder']['show'] = true;
$this->_sections['ladder']['max'] = $this->_sections['ladder']['loop'];
$this->_sections['ladder']['step'] = 1;
$this->_sections['ladder']['start'] = $this->_sections['ladder']['step'] > 0 ? 0 : $this->_sections['ladder']['loop']-1;
if ($this->_sections['ladder']['show']) {
    $this->_sections['ladder']['total'] = $this->_sections['ladder']['loop'];
    if ($this->_sections['ladder']['total'] == 0)
        $this->_sections['ladder']['show'] = false;
} else
    $this->_sections['ladder']['total'] = 0;
if ($this->_sections['ladder']['show']):

            for ($this->_sections['ladder']['index'] = $this->_sections['ladder']['start'], $this->_sections['ladder']['iteration'] = 1;
                 $this->_sections['ladder']['iteration'] <= $this->_sections['ladder']['total'];
                 $this->_sections['ladder']['index'] += $this->_sections['ladder']['step'], $this->_sections['ladder']['iteration']++):
$this->_sections['ladder']['rownum'] = $this->_sections['ladder']['iteration'];
$this->_sections['ladder']['index_prev'] = $this->_sections['ladder']['index'] - $this->_sections['ladder']['step'];
$this->_sections['ladder']['index_next'] = $this->_sections['ladder']['index'] + $this->_sections['ladder']['step'];
$this->_sections['ladder']['first']      = ($this->_sections['ladder']['iteration'] == 1);
$this->_sections['ladder']['last']       = ($this->_sections['ladder']['iteration'] == $this->_sections['ladder']['total']);
?>
					 <?php if ($this->_tpl_vars['LadderArr'][$this->_sections['ladder']['index']]['countrow'] != '0'): ?>
                     <li>
					 <a href="#"
onclick="ManagerGeneral('<?php echo $this->_tpl_vars['page_name']; ?>
?action=list_search&dosearch=GO&ladder_id=<?php echo $this->_tpl_vars['LadderArr'][$this->_sections['ladder']['index']]['ladder_id']; ?>
&<?php echo $this->_tpl_vars['SLink']; ?>
&from=<?php echo $this->_tpl_vars['from']; ?>
&from_page=<?php echo $this->_tpl_vars['from_page']; ?>
')"><?php echo $this->_tpl_vars['LadderArr'][$this->_sections['ladder']['index']]['ladder_name']; ?>
<span>(<?php echo $this->_tpl_vars['LadderArr'][$this->_sections['ladder']['index']]['countrow']; ?>
)</span></a></li>
					 <?php endif; ?>
                    <?php endfor; endif; ?>
                </ul>
            </li>
			<?php endif; ?>
			
        	<li><a href="#">Rating</a>
                <ul>
                    <li><a href="#" onclick="ManagerGeneral('<?php echo $this->_tpl_vars['page_name']; ?>
?action=list_search&from=<?php echo $this->_tpl_vars['from']; ?>
&from_page=<?php echo $this->_tpl_vars['from_page']; ?>
')">All <span>(<?php echo $this->_tpl_vars['totRec']; ?>
)</span></a></li>
                    <?php unset($this->_sections['rating']);
$this->_sections['rating']['name'] = 'rating';
$this->_sections['rating']['loop'] = is_array($_loop=$this->_tpl_vars['StarArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['rating']['show'] = true;
$this->_sections['rating']['max'] = $this->_sections['rating']['loop'];
$this->_sections['rating']['step'] = 1;
$this->_sections['rating']['start'] = $this->_sections['rating']['step'] > 0 ? 0 : $this->_sections['rating']['loop']-1;
if ($this->_sections['rating']['show']) {
    $this->_sections['rating']['total'] = $this->_sections['rating']['loop'];
    if ($this->_sections['rating']['total'] == 0)
        $this->_sections['rating']['show'] = false;
} else
    $this->_sections['rating']['total'] = 0;
if ($this->_sections['rating']['show']):

            for ($this->_sections['rating']['index'] = $this->_sections['rating']['start'], $this->_sections['rating']['iteration'] = 1;
                 $this->_sections['rating']['iteration'] <= $this->_sections['rating']['total'];
                 $this->_sections['rating']['index'] += $this->_sections['rating']['step'], $this->_sections['rating']['iteration']++):
$this->_sections['rating']['rownum'] = $this->_sections['rating']['iteration'];
$this->_sections['rating']['index_prev'] = $this->_sections['rating']['index'] - $this->_sections['rating']['step'];
$this->_sections['rating']['index_next'] = $this->_sections['rating']['index'] + $this->_sections['rating']['step'];
$this->_sections['rating']['first']      = ($this->_sections['rating']['iteration'] == 1);
$this->_sections['rating']['last']       = ($this->_sections['rating']['iteration'] == $this->_sections['rating']['total']);
?>
					<li><a href="#"
onclick="ManagerGeneral('<?php echo $this->_tpl_vars['page_name']; ?>
?action=list_search&dosearch=GO&overall_rating=<?php echo $this->_tpl_vars['StarArr'][$this->_sections['rating']['index']]['star']; ?>
&<?php echo $this->_tpl_vars['SLink']; ?>
&from=<?php echo $this->_tpl_vars['from']; ?>
&from_page=<?php echo $this->_tpl_vars['from_page']; ?>
')">
                    <?php echo $this->_tpl_vars['StarArr'][$this->_sections['rating']['index']]['star']; ?>
 Star <span>(<?php echo $this->_tpl_vars['StarArr'][$this->_sections['rating']['index']]['countrow']; ?>
)</span></a></li>
					<?php endfor; endif; ?>
                </ul>
            </li>
        
        </ul>
	   </li>
       
    </ul>
   </div>   
   </div> -->
   

<div class="right-panel">
<!--this is the loading screen div-->
<div id="loading" class="loading-visible">
</div>
<!--this is the loading screen JavaScript-->
      <div class="title">Replays</div>
	  <div class="clear"></div>
      <div class="searchpanel" style=''>
           <form action="<?php echo $this->_tpl_vars['page_name']; ?>
" method="post" name="form_search" id="form_search" >
              <fieldset>
			  <select name="order_by" id="order_by" onchange="subForm(this.value);">
				<option value="">Sort By</option>
				<option value="time_length" <?php if ($this->_tpl_vars['sorting_by'] == 'time_length'): ?> selected="selected" <?php endif; ?> >Duration(Low)</option>
				<option value="time_length-DESC" <?php if ($this->_tpl_vars['sorting_by'] == 'time_length-DESC'): ?> selected="selected" <?php endif; ?> >Duration(High)</option>
				<option value="date_added" <?php if ($this->_tpl_vars['sorting_by'] == 'date_added'): ?> selected="selected" <?php endif; ?> >Upload Date(Ascending)</option>
				<option value="date_added-DESC" <?php if ($this->_tpl_vars['sorting_by'] == 'date_added-DESC'): ?> selected="selected" <?php endif; ?> >Upload Date(Discending)</option>
				<option value="review" <?php if ($this->_tpl_vars['sorting_by'] == 'review'): ?> selected="selected" <?php endif; ?> >View Count(Ascending)</option>
				<option value="review-DESC" <?php if ($this->_tpl_vars['sorting_by'] == 'review-DESC'): ?> selected="selected" <?php endif; ?> >View Count(Discending)</option>
			   </select>
			  
			  
			  
			  
			 <!-- <input name="vnm" class="text" type="text" id="vnm" <?php if ($this->_tpl_vars['vdotitle'] != ''): ?>value="<?php echo $this->_tpl_vars['vdotitle']; ?>
"<?php else: ?>value="Keyword"<?php endif; ?> />
			  <input type="button" value="" onclick="searchVdo()" />-->
			  <!--input type="button" value="clear" onclick="resetSearch()" /-->
                
               </fieldset>
            </form>
           <div class="clear"></div>
      </div>
      <div class="clear"></div>
	  <?php if ($this->_tpl_vars['NumReplay'] > 0): ?>
      <div class="game-list">
	  <?php unset($this->_sections['videoRow']);
$this->_sections['videoRow']['name'] = 'videoRow';
$this->_sections['videoRow']['loop'] = is_array($_loop=$this->_tpl_vars['ReplayArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['videoRow']['show'] = true;
$this->_sections['videoRow']['max'] = $this->_sections['videoRow']['loop'];
$this->_sections['videoRow']['step'] = 1;
$this->_sections['videoRow']['start'] = $this->_sections['videoRow']['step'] > 0 ? 0 : $this->_sections['videoRow']['loop']-1;
if ($this->_sections['videoRow']['show']) {
    $this->_sections['videoRow']['total'] = $this->_sections['videoRow']['loop'];
    if ($this->_sections['videoRow']['total'] == 0)
        $this->_sections['videoRow']['show'] = false;
} else
    $this->_sections['videoRow']['total'] = 0;
if ($this->_sections['videoRow']['show']):

            for ($this->_sections['videoRow']['index'] = $this->_sections['videoRow']['start'], $this->_sections['videoRow']['iteration'] = 1;
                 $this->_sections['videoRow']['iteration'] <= $this->_sections['videoRow']['total'];
                 $this->_sections['videoRow']['index'] += $this->_sections['videoRow']['step'], $this->_sections['videoRow']['iteration']++):
$this->_sections['videoRow']['rownum'] = $this->_sections['videoRow']['iteration'];
$this->_sections['videoRow']['index_prev'] = $this->_sections['videoRow']['index'] - $this->_sections['videoRow']['step'];
$this->_sections['videoRow']['index_next'] = $this->_sections['videoRow']['index'] + $this->_sections['videoRow']['step'];
$this->_sections['videoRow']['first']      = ($this->_sections['videoRow']['iteration'] == 1);
$this->_sections['videoRow']['last']       = ($this->_sections['videoRow']['iteration'] == $this->_sections['videoRow']['total']);
?>
	   	 <form name="videoform<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
" id="videoform<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
" method="post" 
			action="videodetails.php?video_id=<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
">
			    <input type="hidden" name="ladders" value="<?php echo $this->_tpl_vars['ladder_id']; ?>
" />
				<input type="hidden" name="races" value="<?php echo $this->_tpl_vars['race_id']; ?>
" />
				<input type="hidden" name="champion_id" value="<?php echo $this->_tpl_vars['champion_id']; ?>
" >
				<input type="hidden" name="class_id" value="<?php echo $this->_tpl_vars['class_id']; ?>
" >
				<input type="hidden" name="map_id" value="<?php echo $this->_tpl_vars['map_id']; ?>
" >
				<input type="hidden" name="mode_id" value="<?php echo $this->_tpl_vars['mode_id']; ?>
" >
				<input type="hidden" name="team_id" value="<?php echo $this->_tpl_vars['team_id']; ?>
" >
				<input type="hidden" name="type_id" value="<?php echo $this->_tpl_vars['type_id']; ?>
" >
				<input type="hidden" name="versus_id" value="<?php echo $this->_tpl_vars['versus_id']; ?>
"  />
				<input type="hidden" name="game_id" value="<?php echo $this->_tpl_vars['game_id']; ?>
"  />
				<input type="hidden" name="Numladder" value="<?php echo $this->_tpl_vars['Numladder']; ?>
" />
				<input type="hidden" name="NumReplay" value="<?php echo $this->_tpl_vars['NumReplay']; ?>
" />
				<input type="hidden" name="NumChampion" value="<?php echo $this->_tpl_vars['NumChampion']; ?>
" />
				<input type="hidden" name="NumClass" value="<?php echo $this->_tpl_vars['NumClass']; ?>
" />
				<input type="hidden" name="NumMap" value="<?php echo $this->_tpl_vars['NumMap']; ?>
" />
				<input type="hidden" name="NumMode" value="<?php echo $this->_tpl_vars['NumMode']; ?>
" />
				<input type="hidden" name="NumTeam" value="<?php echo $this->_tpl_vars['NumTeam']; ?>
" />
				<input type="hidden" name="NumType" value="<?php echo $this->_tpl_vars['NumType']; ?>
" />
				<input type="hidden" name="NumVersus" value="<?php echo $this->_tpl_vars['NumVersus']; ?>
" />
		  <?php $this->assign('v', $this->_sections['videoRow']['index']+1); ?>
			 <div <?php if ($this->_tpl_vars['v']%3 == '0'): ?>class="games-replay-last"<?php else: ?>class="games-replay"<?php endif; ?> >
			   <div class="replay-content" >
			  <!-- <a href="videodetails.php?video_id=<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
">-->
			   <a href="#" onclick="redirect_function(<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
)">
			   <img src="uploaded/video_images/thumbs/mid_<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_image']; ?>
" alt="" border="0" /></a>
			   
			   </div>
			   <div class="replay-content">
				  <div class="replay-title">
				  <a href="#" onclick="redirect_function(<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
)"><?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_title']; ?>
</a>
				  <br /><span class="date"><?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_date']; ?>
<br />
				  <?php if ($this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['time_length'] != ''):  echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['time_length']; ?>
 min<?php else: ?>N/A<?php endif; ?>
				  </span></div>
				  <!--<?php if ($this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['user_id'] != $_SESSION['user_id'] && $_SESSION['user_id'] != ''): ?>
				  <div id="game-rating_<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
">			 
				  <a href="javascript:;" onclick="return LikeVideo(<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['user_id']; ?>
,<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
,'<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['like']; ?>
',<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['numlike']; ?>
)">
				  <div class="game-rating"><?php if ($this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['like'] == 'Y'): ?> <img alt="Unlike" src="images/unlike.png"> <?php else: ?> <img alt="Like" src="images/like.png"> <?php endif; ?></div>  
				  </a>      
				  </div>  
				  <?php endif; ?> -->
				    <div class="game-rating">
					<strong>Likes :</strong>&nbsp;<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['numlike']; ?>

					<!--<span id="votes_<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
"></span>-->
					<br />
					<strong>Disikes :</strong>&nbsp;<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['numunlike']; ?>

					<br />
					<strong>Views :</strong>&nbsp;<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['view_count']; ?>
  
					
					<!--<span id="votes_<?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['video_id']; ?>
"></span>-->
					</div> 
					<br  />
				         					
                  <div class="replay-title" style="padding-top:0px; width:90%"><span class="date">by <em><?php echo $this->_tpl_vars['ReplayArr'][$this->_sections['videoRow']['index']]['user']; ?>
</em></span></div>
                 
			   </div>
			 </div>
		  <?php if ($this->_tpl_vars['v']%3 == '0'): ?><div class="clear"></div><?php endif; ?>
		  </form>	 
        <?php endfor; endif; ?>
       <div class="clear"></div>
      </div>
      <?php if ($this->_tpl_vars['pagination_arr'][1]): ?>
      <div class="clear"></div>
      <div class="pagin">
         <ul>
            <?php echo $this->_tpl_vars['pagination_arr'][1]; ?>

         </ul>
      </div>
	  <?php endif; ?>
	 <?php else: ?>
	    No Replays is found......
     <?php endif; ?>
   </div>
</div>
<?php echo '
<style type="text/css">  
  div.loading-visible{
    /*make visible*/
    display:block;
    /*position it 200px down the screen*/
    position:absolute;
    top:200px;
    left:145px;
    width:100%;
    text-align:center;
    /*in supporting browsers, make it
      a little transparent*/    
	filter: alpha(opacity=75); /* internet explorer */
	-khtml-opacity: 0.75;      /* khtml, old safari */
	-moz-opacity: 0.75;       /* mozilla, netscape */
	opacity: 0.75;           /* fx, safari, opera */
   
  }
</style>
'; ?>